<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // // 数组解构赋值
        // let arr = [1, 2, 3]
        // let [a, b, c] = arr
        // console.log(a, b, c)

        // 对象解构赋值
        // let obj = {
        //     name: "卡莎",
        //     skill: "虚空索敌"
        // }
        // // let {name:myname, skill:myskill} = obj
        // let {name, skill} = obj
        // console.log(name, skill)

        // let obj = {
        //     name: "张小三",
        //     hobby: ["张三", "李四", "王五"],
        //     obj1: {
        //         myname: "王健林",
        //         age: 60
        //     }
        // }
        // let { name,
        //     hobby,
        //     obj1,
        //     obj1: {
        //         myname,
        //         age
        //     },
        // } = obj
        // console.log(name, hobby, obj1, myname, age)

        //字符串解构赋值
        let str = "hello"
        let res = str.split('')

        let [a, b, c, d, e] = res
        console.log(a, b, c, d, e)






    </script>
</body>

</html>